package com.ikun.mapper;

import com.ikun.pojo.TbUserPrize;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface TbUserPrizeMapper {

    @Insert("INSERT into tb_user_prize (userid,prizeid,time) VALUES (#{userid},#{prizeid},#{time})")
    public int cashRewards(@Param("userid") Long userid, @Param("prizeid") Long prizeid, @Param("time") String time);
    //查询兑换奖品的信息
    public List<TbUserPrize> selectmsg();
    //查询兑换奖品的记录
    public List<TbUserPrize> selectprize();
    //修改交易时间（管理端）
    @Update("update tb_user_prize set finishtime =#{finishtime} where id = #{id}")
    public int check(@Param("id") int id, @Param("finishtime") String finishtime);
    //删除/忽略记录的方法
    @Delete("delete from tb_user_prize where id = #{id}")
    public int delprize(@Param("id") int id);
}
